import { axios } from '@/utils/request'
// 添加商品spu
export function addGoodSpu (parameter, type = 'add') {
    return axios({
        url: `/inventory/goods/${type}/spu`,
        method: 'post',
        data: parameter
    })
}

// 获取产品
export function getOpenProductList (parameter) {
    return axios({
        // url: '/merchant/admin/products/list/open/product',
        url: '/merchant/admin/products/channel/autocomplete',
        method: 'post',
        data: parameter
    })
}

// 添加商品sku
export function addGoodSku (parameter) {
    return axios({
        url: '/inventory/goods/add/sku',
        method: 'post',
        data: parameter
    })
}

// 高级设置
export function seniorSet (parameter) {
    return axios({
        url: '/inventory/goods/senior/set',
        method: 'post',
        data: parameter
    })
}

// 获取商品列表
export function getGoodsList (parameter) {
    return axios({
        url: '/inventory/goods/spu/list',
        method: 'post',
        data: parameter
    })
}

// 获取商品spu信息
export function getSpuInfo (parameter) {
    return axios({
        url: '/inventory/goods/spu/info',
        method: 'post',
        data: parameter
    })
}

// 获取商品spu信息
export function getSkuInfo (parameter) {
    return axios({
        url: '/inventory/goods/sku/info',
        method: 'post',
        data: parameter
    })
}

// 获取高级设置信息
export function getSetInfo (parameter) {
    return axios({
        url: '/inventory/goods/senior/set/query',
        method: 'post',
        data: parameter
    })
}

// spu上下架删除
export function spuAct (parameter) {
    return axios({
        url: '/inventory/goods/spu/status/edit',
        method: 'post',
        data: parameter
    })
}

// sku编辑
export function skuEdit (parameter) {
    return axios({
        url: '/inventory/goods/sku/edit',
        method: 'post',
        data: parameter
    })
}

// 获取下发店铺
export function getStoreSetList (parameter) {
    return axios({
        url: '/merchant/admin/store/set/list',
        method: 'post',
        data: { ...parameter, noStore: 1 }
    })
}

// 商品下发
export function goodsIssue (parameter) {
    return axios({
        url: '/inventory/goods/push/subordinate',
        method: 'post',
        data: parameter
    })
}
// 编辑spu的排序
export function editSpuRank (parameter) {
    return axios({
        url: '/inventory/goods/edit/spu/rank',
        method: 'post',
        data: parameter
    })
}
// sku上下架
export function changeSkuStatus (parameter) {
    return axios({
        url: '/inventory/goods/sku/status/edit',
        method: 'post',
        data: parameter
    })
}

// 批量修改商品分类
export function goodsBatchCategory (parameter) {
    return axios({
        url: '/inventory/goods/batch/category/edit',
        method: 'post',
        data: parameter
    })
}

// 批量修改商品发布渠道
export function goodsBatchSet (parameter) {
    return axios({
        url: '/inventory/goods/senior/batch/set',
        method: 'post',
        data: parameter
    })
}
